Xbasic

DATE Function

Syntax

Todays_Date as D = DATE()

Returns

todays_dateDate

Returns the current date as a date type.

Description

Returns the current system date.

Discussion

DATE() returns today's date. The system date must be set at the DOS level (use the DOS DATE command). This function is useful for fields that should contain the current date.

Example

Assume that you want to use a range filter in View mode to display only the records for overdue accounts. If your table stores the date that an order was placed in a field called ORDERDATE, the following expression yields the number of days since the order was placed:

date() -ORDERDATE

You can generate a complete filter expression to find all open accounts over 30 days old by adding a check on a BALANCEDUE field. The filter is:

((date() - ORDERDATE) > 30) .AND. (BALANCEDUE > 0)

See Also